fix: 5592 surface IPFS errors during profile setup#5993
Merged
Conversation
createSystemSchemas was swallowing publish failures and returning null, which caused createUserProfile to sign a VC without an @context and fail with a misleading MISSING_PROPERTIES_IN_CONTEXT JSON-LD error. Rethrow the original error and fail fast with an actionable message pointing at IPFS provider credentials when the SR entity schema is missing. Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes two user-visible failure modes when IPFS is misconfigured:
MISSING_PROPERTIES_IN_CONTEXTJSON-LD error that hides the real cause.Four chained defects are addressed:
IpfsClientClassdereferences an uninitialized client. AddedassertClientReady()guard onaddFile/deleteCidso a failed client init produces a readable error instead ofTypeError: Cannot read properties of undefined (reading 'uploadFile'). The worker process is intentionally kept alive so per-tenant misconfiguration in multi-tenant forks doesn't take the whole worker down.queue-servicesuppressedTASK_COMPLETEfor user-facing tasks. Removed twoif (!task.interception)guards so terminal failures always publish the completion event. Every call site that setsinterceptionalready pairs withregisterCallback: true, and no alternate completion path exists, the guards were dormant-bug code. AwaitingPromises inaddRetryableTask/addNonRetryableTasknow reject instead of hanging.createSystemSchemasswallowed publish errors. Rethrow instead of returningnull. Thenullreturn is now reserved for the legitimate "no entity schema" case. A fail-fast guard increateUserProfilenow throwsSystem schema for entity "X" not found. when the template is missing, rather than signing a VC without@context.Related issue(s):
Fixes #5992
Notes for reviewer:
worker-service/src/api/ipfs-client-class.ts–assertClientReady()guard added toaddFileanddeleteCid.queue-service/src/queue-service/queue-service.ts– removed!task.interceptionguards in theTASK_COMPLETEhandler.guardian-service/src/api/helpers/profile-helper.ts– rethrow increateSystemSchemas, rethrow on DID publish failure, fail-fast guard before VC signing.Checklist